package com.jobinn.web.manageAction;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class DoManageAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(
				this.getServlet().getServletContext()); 
		
		response.setContentType("text/html");
		request.setCharacterEncoding("GB2312"); 
		response.setCharacterEncoding("GB2312");
		String item = request.getParameter("item");
		String foward = "";
		if("user".equals(item)){
			foward = "user";
		}else if("cv".equals(item)){
			foward = "cv";
		}else if("job".equals(item)){
			foward = "job";
		}else if("analysis1".equals(item)){
			foward = "analysis1";
		}else if("analysis2".equals(item)){
			foward = "analysis2";
		}else if("backHome".equals(item)){
			foward = "home";
		}else if("widgets".equals(item)){
			foward = "widgets";
		}else if("jobinnSpider".equals(item)){
			foward = "jobinnSpider";
		}
		return mapping.findForward(foward);
	}
	
}
